package com.atguigu.gmall.service.impl;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.gmall.bean.UserAddress;
import com.atguigu.gmall.service.OrderService;
import com.atguigu.gmall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
//    @Autowired
    @Reference//(url = "192.168.80.1:20080")//dubbo提供的注解，帮我们远程引入这个服务，它自己会从注册中心来发现
    UserService userService;
    @Override
    public List<UserAddress> initOrder(String userId) {
        System.out.println("id是:"+userId);
        //1、查询用户收货地址
        List<UserAddress> list = userService.getUserAddressList(userId);
        return list;
    }
}
